import java.util.Scanner;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 04 - 18
 * Time: 14:05
 */
//数组中是否存在连续三个元素都是奇数的情况：如果存在，返回true；否则，返回false
public class test6 {
    public static boolean search(int[] arr1) {
        for (int i = 0; i < arr1.length; i++) {
            if ((arr1[i] % 2 == 1) && (arr1[i + 1] % 2 == 1) && (arr1[i + 2] % 2 == 1)) {
                return true;
            } else if (i == arr1.length - 3) {
                return false;
            }
        }
        return false;
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] arr1 = new int[15];
        for (int i = 0; i < arr1.length; i++) {
            arr1[i] = scanner.nextInt();
        }
        System.out.println(search(arr1));
    }
}
